<!--{template common/header}-->

<div id="pt" class="wp">
	<a href="index.php" class="nvhm">$_G[setting][bbname]</a> &rsaquo; 
	<a href="portal.php">{lang portal}</a> &rsaquo;
	<a href="portal.php?mod=portalcp">{lang category_management}</a> &rsaquo;
	<a href="portal.php?mod=category&catid=$cate[catid]">$cate[catname]</a>
</div>

<div id="ct" class="wp cl">
	<div class="mn">
		<div class="ch">
			<label class="wx"><a href="portal.php">{lang portal}</a></label>
		</div>
		<div class="bm">
			<ul class="tb cl">
				<li class="a"><a href="portal.php?mod=portalcp&ac=index">{lang category_management}</a></li>
				<li><a href="portal.php?mod=portalcp&ac=portalblock">{lang block_management}</a></li>
				<li class="o"><a href="portal.php?mod=portalcp&ac=article&catid=$catid" target="_blank">{lang article_new}</a></li>
			</ul>
			<div class="tbmu bbn cl">
				<form method="get" href="portal.php" class="pns y">
					<input type="hidden" name="mod" value="portalcp" />
					<input type="hidden" name="ac" value="category" />
					<input type="hidden" name="type" value="$_GET[type]" />
					<input type="hidden" value="$cate[catid]" name="catid" />
					<input type="hidden" value="{FORMFASH}" name="formhash" />
					<input type="text" name="searchkey" class="px vm" value="$_GET[searchkey]" /> 
					<button type="submit" value="true" class="pn vm"><em>{lang search}</em></button>
				</form>
				<p class="mtn">
					{lang article_list}:
					<a href="portal.php?mod=portalcp&ac=category&catid=$cate[catid]&type=all"$typearr[all]>{lang all}</a><span class="pipe">|</span>
					<a href="portal.php?mod=portalcp&ac=category&catid=$cate[catid]&type=unpushed"$typearr[unpushed]>{lang unpushed}</a><span class="pipe">|</span>
					<a href="portal.php?mod=portalcp&ac=category&catid=$cate[catid]&type=pushed"$typearr[pushed]>{lang pushed}</a>
				</p>
			</div>
			<form name="articlelist" id="articlelist" action="portal.php?mod=portalcp&ac=article&op=batch" method="post" onsubmit="return checkPushSubmit(this);">
				<input type="hidden" value="true" name="batchsubmit"/>
				<input type="hidden" value="{FORMFASH}" name="formhash"/>
				<input type="hidden" value="$cate[catid]" name="catid"/>
				<table class="dt">
					<tr>
						<th width="50">&nbsp;</th>
						<th>{lang article_subject}</th>
						<th width="90">{lang author}</th>
						<th width="90">{lang article_operation}</th>
					</tr>
					<!--{loop $list $key $value}-->
					<tr>
						<td><input type="checkbox" value="$value[aid]" name="aids[]" class="pc" /></td>
						<td><a href="portal.php?mod=view&aid=$value[aid]" title="$value[title]" target="_blank"><!--{if $value['shorttitle']}-->$value['shorttitle']<!--{else}-->$value['title']<!--{/if}--></a></td>
						<td>
							<a href="home.php?mod=space&uid=$value[uid]" title="{lang view_space}" target="_blank">$value[username]</a>
							<br /><span class="xs0 xg1">$value[dateline]</span>
						</td>
						<td>
							<!--{if $value['allowmanage']}-->
							<a href="portal.php?mod=portalcp&ac=article&op=edit&aid=$value[aid]" target="_blank">{lang edit}</a>
							<a href="portal.php?mod=portalcp&ac=article&op=delete&aid=$value[aid]" onclick="showWindow(this.id, this.href, 'get', 0);" id="article_delete_$value[aid]">{lang delete}</a>
							<!--{/if}-->
							<!--{if $value['allowpush']}-->
							<a id="artilcle_push_$key" href="portal.php?mod=portalcp&ac=article&op=push&aid=$value[aid]" onclick="showWindow('pusharticle', this.href, 'get', 0)">{lang article_push}</a>
							<!--{/if}-->
						</td>
					</tr>
					<!--{/loop}-->
					<tr>
						<td><input type="checkbox" onclick="checkall(this.form, 'aids')" class="pc vm" id="chkall" name="chkall" /> <label for="chkall">{lang select_all}</label></td>
						<td colspan="4">
							{lang article_operation}:&nbsp;&nbsp;
							<input type="radio" id="op_trash" class="pr vm" value="trash" name="optype"><label for="op_trash">{lang article_delete_recyclebin}</label>&nbsp;&nbsp;
							<input type="radio" id="op_delete" class="pr vm" value="delete" name="optype"><label for="op_delete">{lang article_delete_direct}</label>&nbsp;&nbsp;
							<input type="radio" id="op_push" class="pr vm" value="push" name="optype"><label for="op_push">{lang article_push}</label>&nbsp;&nbsp;
							<button type="submit" value="true" name="trashsubmit" class="pn vm"><em>{lang submit}</em></button>
						</td>
					</tr>
				</table>
			</form>
			<!--{if $multi}--><div class="pgs cl">$multi</div><!--{/if}-->

		</div>
	</div>
	<div class="sd">
		{subtemplate common/userabout}
	</div>
</div>

<script type="text/javascript">
function checkPushSubmit(form){
	var arr = [];
	var checkbox = form.getElementsByTagName('input');
	for(var i = 0; i<checkbox.length; i++){
		if (checkbox[i].name == 'aids[]' && checkbox[i].checked) arr.push(checkbox[i].value);
	}
	if (arr.length == 0) {
		alert('{lang article_not_choose}');
		return false;
	}
	if($('op_push').checked) {
		var aid = arr.join(',');
		showWindow('pusharticle', 'portal.php?mod=portalcp&ac=article&op=push&aid='+aid, 'get', 0)
		return false;
	}
	if(!$('op_trash').checked && !$('op_delete').checked) {
		alert('{lang action_invalid}');
		return false;
	}
	return true;
}
</script>
<!--{template common/footer}-->